<template>
    <div>
        <el-row :gutter="20">
            <el-col :span="8">
                <el-card shadow="always">
                    <div slot="header" class="text-left">做过的试卷数</div>
                    <h2>{{ card_info.examHistoryCount }}</h2>
                </el-card>
            </el-col>
            <el-col :span="8">
                <el-card shadow="always">
                    <div slot="header" class="text-left">总错题数</div>
                    <h2>{{ card_info.wrongQuestionCount }}</h2>
                </el-card>
            </el-col>
            <el-col :span="8">
                <el-card shadow="always">
                    <div slot="header" class="text-left">平均错题率</div>
                    <h2>{{ card_info.wrongQuestionCount / card_info.examHistoryCount }}</h2>
                </el-card>
            </el-col>
        </el-row><br>
        <el-row>
            <el-col>
                <!-- <h2>最近一周的做过的试卷数</h2>
                <ve-line :data="chartData"></ve-line> -->
                <img src="https://api.xygeng.cn/Bing/" alt="" style="width: 100%;">
            </el-col>
        </el-row>
    </div>
</template>
<script>
import {get_exam_count, get_wrong_count} from "@/api/user"

export default {
    name: "Home",
    data(){
        return{
            card_info: {
                examHistoryCount: 0,
                wrongQuestionCount: 0
            }
        }
    },
    methods:{

    },
    mounted(){
        get_exam_count().then(res=>{
            this.card_info.examHistoryCount = res.data
        })
        get_wrong_count().then(res => {
            this.card_info.wrongQuestionCount = res.data
        })
    }
}
</script>
<style scoped>

</style>